<%@ Page Language="vb" AutoEventWireup="false" Codebehind="ProductCodeListDialog.aspx.vb" Inherits="MIMS_WRS.Web.ProductCodeListDialog" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
	<HEAD>
		<title>ProductCodeListDialog</title>
		<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
		<meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
		<meta name="vs_defaultClientScript" content="JavaScript">
		<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
		<LINK href="../style.css" type="text/css" rel="stylesheet">
		<script language="javascript" src="../Js/EventCapture.js"></script>
		<script language="javascript" src="../Js/ScrollableTable.js"></script>
		<script language="javascript">
		<!--
		var isSelected=false;
		function rdb_onclick(obj) {
			isSelected = true;					
		}
		
		function Select_onclick() {		
			
			if (isSelected) {
				var rdb=document.all['rdbSelect'];				
				var idx=0;			
				
				if (rdb.length) {
					for (i=0; i<rdb.length; i++) 
						if (rdb[i].checked)	{
							idx = i;
							break;					
						}			
				}		
				var tbl=document.all['tblProductCode'];								
				
				var obj = new Object();				
				if (rdb.length)
					obj.ID = rdb[idx].value;
				else
					obj.ID = rdb.value
				
				obj.Code = tbl.tBodies[0].rows[idx].cells[1].innerText;
				obj.PartOfBarcode = tbl.tBodies[0].rows[idx].cells[2].innerText;
				obj.Description = tbl.tBodies[0].rows[idx].cells[3].innerText;
				window.parent.returnValue=obj;
				window.parent.close();
			} else {
				alert('Please choose an item from the list');
			};
		}
		//-->
		</script>
	</HEAD>
	<body leftmargin="0" rightmargin="0" topmargin="0" bottommargin="0" >
		<form id="Form1" method="post" runat="server">
			<table border="0" cellpadding="0" cellspacing="0" width="100%">
				<TBODY>
					<tr>
						<td>
							<asp:Repeater id="repProCode" runat="server" EnableViewState="False">
								<HeaderTemplate>
									<table id="tblProductCode" name="tblProductCode" width="270" bordercolor="black" style="BORDER-COLLAPSE: collapse"
										border="1" cellpadding="2" cellspacing="0" class="txtsmall">
										<thead>
											<tr>
												<td width="1%" align="center">
												</td>
												<td width="1%">Code</td>
												<td width="1%">Part of barcode</td>
												<td>Description</td>
											</tr>
										</thead>
										<tbody>
								</HeaderTemplate>
								<ItemTemplate>
									<tr>
										<td><input type=radio  onclick="rdb_onclick(this)" name=rdbSelect value='<%#DataBinder.Eval(Container, "DataItem.PRODUCT_CODE_ID_PK")%>'></td>
										<td><%#DataBinder.Eval(Container, "DataItem.Code")%></td>
										<td><%#DataBinder.Eval(Container, "DataItem.PART_OF_BARCODE")%></td>
										<td><%#DataBinder.Eval(Container, "DataItem.DESCRIPTION")%></td>
									</tr>
								</ItemTemplate>
								<FooterTemplate>
				</TBODY>
			</table>
			</FooterTemplate> </asp:Repeater></TD></TR></TBODY></TABLE>
			<table align="center" width="100%">
				<tr>
					<td align="center" height="25">
						<INPUT type="button" value="Select" onclick="Select_onclick()" class="button">&nbsp;<INPUT type="button" value="Cancel" onclick="window.parent.close()" class="button"></td>
				</tr>
			</table>
		</form>
	</body>
</HTML>
